linux编译安装php nginx部分代码

安装php

1
2
3
4
5
6
7
8
9
./configure --prefix=/home/php5.6 --enable-fpm --with-png-dir  --with-gd  --enable-gd-native-ttf  
--enable-gd-jis-conv --with-png-dir --with-zlib --with-zlib-dir --with-freetype-dir
--with-mysql --enable-mysqlnd
#查找帮助./configure --help|grep fpm
#make && make install
经过漫长时间的等待
#cp php.ini-development /usr/local/php5/lib/php.ini 复制 php.ini
#cp /usr/local/php5/etc/php-fpm.conf.default php-fpm.conf 复制 fpm 配置文件
#/usr/local/php5/bin/php -varsoin

##nginx 安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#./configure --prefix=/usr/local/nginx  --with-http_stub_status_module --with-http_ssl_module //后面为 https 模块 
.....
#/usr/local/nginx/sbin/nginx
打开浏览器 http://localhost
Welcome to nginx! 安装成功
nginx 支持 php
#vi /usr/local/nginx/conf/nginx.conf
把以下取消注释
location ~ .php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html/$fastcgi_script_name;
include fastcgi_params;
}
重启 nginx
#pkill -9 nginx
#/usr/local/nginx/sbin/nginx